{% extends "reception/reception_page.html" %}
{% load reception_tags %}
{% load static %}
<!doctype html>
<html lang="ru">


{% block head %}

{% if object.title %}
  {% autoescape off %}
    <title>{{ object.title }}</title>
  {% endautoescape %}
{% endif %}

{% if object.keywords %}
  {% autoescape off %}
    <meta name="keywords" content="{{ object.keywords|safe }}">
  {% endautoescape %}
{% endif %}

{% if object.description %}
  {% autoescape off %}
    <meta name="description" content="{{ object.description|safe }}">
  {% endautoescape %}
{% endif %}

{% if object.snippet %}
  {% autoescape off %}
    <meta name="snippet" content="{{ object.snippet|safe }}">
  {% endautoescape %}
{% endif %}

{% endblock %}


{% block menu %}
  {% if object.element_menu %}

    {% autoescape off %}
      {% menu_var filter='MENU_LANDING' id_page=data_pages %}
    {% endautoescape %}

  {% else %}

    {% autoescape off %}
      {% menu_var filter='MENU' %}
    {% endautoescape %}

  {% endif %}
{% endblock %}



{% block page %}

{% if messages %}
<div class="alert alert-primary" role="alert">
  {% for message in messages %}
    <div  {% if message.tags %} class=" {{ message.tags }} " {% endif %}> {{ message }} </div>
  {% endfor %}
  {% endif %}

</div>

{% if object.breadcrumb %}
  <div class="card shadow-sm my-3">
    <nav aria-label="breadcrumb">
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="{% url 'reception:home_page' %}">Главная</a></li>

      <li class="breadcrumb-item active" aria-current="page">{{ object.title }}</li>
    </ol>
    </nav>
  </div>
{% endif %}

<div class="card shadow-sm my-3" id="{{ object.slug }}">
  {% if object.title %}
  <div class="card-header"><h5>{{ object.title }}</h5></div>
  {% else %}
  {% endif %}

    <div class="card-body">
      {{ object.code_content|safe }}
      {{ object.content|safe }}
    </div>
  </div>


{% if object.carousel %}

    {% include "reception/carousel.html" with corusel_data=object.carousel slides_list=slides_obj only %}

{% endif %}


{% for page_i in data_pages %}
<div class="card shadow-sm my-3" id="{{ page_i.slug }}">
  {% if page_i.title %}
  <div class="card-header"><h5>{{ page_i.title }}</h5></div>
  {% else %}

  {% endif %}
  <div class="card-body" >
    {{ page_i.code_content|safe }}
    {{ page_i.content|safe }}
    </div>
  </div>
{% endfor %}


{% if object.form_message == 'EXTERNAL' %}
  <div class="row">
    <div class="col-lg-4"> </div>
    {% autoescape off %}
      <div class="col-lg-4">{% get_apps filter='FEEDBACK_FORM'%}</div>
    {% endautoescape %}
    <div class="col-lg-4"> </div>
  </div>
{% endif %}

{% if object.form_message == 'OWN' %}
  <div class="row">
    <div class="col-lg-4"> </div>
    <div class="card shadow-lg col-lg-4 rounded" id="message">
      <div class="text-center p-3"><h5>Отправьте нам сообщение</h5></div>
      <hr>
        <div class="card-body">
          {% if messages %}
          <div class="alert alert-primary" role="alert">
            {% for message in messages %}
              <div  {% if message.tags %} class=" {{ message.tags }} " {% endif %}> {{ message }} </div>
            {% endfor %}
            {% endif %}

          </div>

          <form method="post" name="call_back">
                  {% csrf_token %}
                {% for field in form_callback %}
              <div class="mb-3">
                {% if field.errors %}
                <ul>
                  <p>{% for error in field.errors %}</p>
                  <li>{{ error }}</li>
                  {% endfor %}
                </ul>
                {% endif %}
                <label for="{{ field.label_tag.id_for_label }}">{{ field.label_tag }}</label>
                <div class="rounded">{{ field }}</div>
              </div>
            {% endfor %}
            <br>
            <div class="form-floating">
            <input class="w-100 btn btn-lg btn-primary"  name="call_back" type="submit" value="Отправить" />
            </div>
            <br>
          </form>

        </div>
      </div>
      <div class="col-lg-4"> </div>
    </div>
{% endif %}


{% endblock %}


</html>
